#include "TBInvokeInterface.h"
CTBInvokeInterface g_TBInvokeInterface;
CTBInvokeInterface::CTBInvokeInterface()
{
	m_hTBInvoke = (HMODULE) LoadLibrary(_T("TBProtocal.dll"));
	if(!m_hTBInvoke)
	{
		return;
	}
//Radio Area
	m_iInitialDeviceComm =			(PFN_INITIALDEVICECOMM)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_InitialDeviceComm"));
	m_iRegisterRadioDataCallback =	(PFN_REGISTERRADIODATACALLBACK)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_RegisterRadioDataCallback"));
	m_iRadioBandChangeCmd =			(PFN_RAIDOBANDCHANGECMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_BandChangeCmd"));
	m_iRadioTunerUpCmd =			(PFN_RADIOTUNERUPCMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_TunerUpCmd"));
	m_iRadioTunerDownCmd =			(PFN_RADIOTUNERDOWNCMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_TunerDownCmd"));
	m_iRadioSeekUpCmd =				(PFN_RADIOSEEKUPCMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_SeekUpCmd"));
	m_iRadioSeekDownCmd =			(PFN_RADIOSEEKDOWNCMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_SeekDownCmd"));
	m_iRadioLocCmd =				(PFN_RADIOLOCCMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_LocCmd"));
	m_iRadioEQCmd =					(PFN_RADIOEQCMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_EQCmd"));
	m_iRadioPresetChangeCmd =		(PFN_RADIOPRESETCHANGECMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_PresetChangeCmd"));
	m_iRadioSavePresetChangeCmd =	(PFN_RADIOSAVEPRESETCHANGECMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_SavePresetChangeCmd"));
	m_iRadioASCmd =					(PFN_RADIOASCMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_ASCmd"));
	m_iRadioPSCmd =					(PFN_RADIOPSCMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_PSCmd"));
	m_iRadioStereoCmd =				(PFN_RADIOSTEREOCMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_StereoCmd"));
	m_iRadioTunerEnterCmd =			(PFN_RADIOTUNERENTERCMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_TunerEnterCmd"));
	m_iRadioFadBalanceCmd =			(PFN_RADIOFADBALANCECMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_FadBalanceCmd"));
	m_iRadioMuteCmd =				(PFN_RADIOMUTECMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_MuteCmd"));
	m_iRadioDDBCmd =				(PFN_RADIODDBCMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_DDBCmd"));
	m_iRadioScanCmd =				(PFN_RADIOSCANCMD)(GetProcAddress(m_hTBInvoke,L"TBPROTOCAL_Radio_ScanCmd"));

}

CTBInvokeInterface::~CTBInvokeInterface()
{
	FreeLibrary(m_hTBInvoke);
}